require "db/migrate/migration_helper"
class CreateProjetos < ActiveRecord::Migration 
extend(MigrationHelper)

  def self.up
    create_table :projetos do |t|
      t.string :nome, :limit => 20, :null => false
      t.text   :descricao
      t.string :licensa, :limit  => 20, :default => "No license"
      t.date  :data_inicio
      t.date  :previsao_termino
      t.float :estimativa_custo, :limit => 15, :default => 0.0
      t.integer :tag_id
      t.timestamps
    end
      foreign_key(:projetos, :tag_id, :tags)
  end

  def self.down
    drop_table :projetos
  end
end
